package com.itheima.health.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.itheima.health.pojo.CheckGroup;
import com.itheima.health.pojo.CheckItem;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface CheckGroupMapper extends BaseMapper<CheckGroup> {

    @Select("SELECT c.* from t_checkitem c join t_checkgroup_checkitem sc on c.id=sc.checkitem_id\n" +
            "join t_checkgroup s on s.id=#{id} and s.id = sc.checkgroup_id")
    List<CheckItem> findByCheckGroupId(Integer id);
}
